<%-- 
    Document   : roomlist
    Created on : 04-12-2009, 08:47:24
    Author     : leaf
--%>

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html; charset=utf-8"%>
<script type="text/javascript">
    function areyousure(url){
        var  answer = confirm("Bạn có chắc chắn muốn xóa không?");

        if(answer){
            window.location.href=url;
        }
        else if(!answer){
            window.location.href="";
        }
    }
</script>
<p class="title">QUẢN TRỊ ROOM </p>
<p class="message">${message}</p>
<hr/>
<table border="1" cellpadding="0" width="100%" cellspacing="0" class="table">
    <tr>        
        <th>Tên phòng</th>
        <th>Mô tả tóm tắt</th>
        <th>Thứ tự hiển thị</th>
        <th>Trạng thái</th>
        <th>Ngày tháng</th>
        <th>Sửa</th>
        <th>Xóa</th>
    </tr>
    <c:forEach var="room" items="${rooms}">
        <tr>           
            <td>${room.name}</td>
            <td>${room.price}</td>
            <td>${room.position}</td>
            <td>${room.status}</td>
            <td>${room.when}</td>
            <td><a href="RoomAction?act=editform&pk=${room.id}">Sửa</a> </td>
            <td><a onclick="areyousure('RoomAction?act=del&pk=${room.id}')">Xóa</a></td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="10"><a  href="RoomAction?act=addform">Thêm mới Room</a></td>
    </tr>
</table>
